<template>
  <div>
    <div>
      <el-button @click="turn">返回</el-button>
    </div>
    <h2><span id="gun">丨</span>修改收款信息</h2>
    <div id="content">
      <p>
        <span class="content-name">银行开户公司名</span><el-input v-model="input" disabled></el-input>
      </p>
      <p><span class="content-name">银行开户账号</span><el-input v-model="input2" ></el-input></p>
      <p><span class="content-name">开户银行所在地</span><el-input v-model="input3" ></el-input></p>
      <p><span class="content-name">开户银行</span><el-input v-model="input4"></el-input></p>
    </div>
    <div>
      <el-button id="sure" type="primary" @click="sure">提交</el-button>
    </div>
    
  </div>
</template>

<script>

import {getTime} from "@/assets/js/public"; 

export default {
  name:"changemoney",
  data() {
    return {
      Httphead:'http://172.16.113.187:8080',
      input: '',
      input2: '',
      input3: '',
      input4: '',
    }
  },
  methods: {
    turn(){
      this.$router.push('storeSet')
    },
    
    sure(){
      this.$axios({
        url: this.Httphead + '/setting/updateSavemoney',
        method: 'post',
        data:{
          name:this.input,
          bankAccount:this.input2,
          bankLocation:this.input3,
          bank:this.input4,
          postbox:this.$store.state.routers.userInfo.number,
          regTime:getTime(),
        }
      }).then((res) => {
          if (res.code === 200) {
            console.log('res',res);
            this.$message({
              message: '修改成功',
              type: 'success',
            })
            this.$router.push('storeSet')
          } else {
            this.$message({
              message: '服务器出错了',
              type: 'error',
            })
          }
        }).catch((err) => {
          console.log('修改失败', err)
        })
    }
  },
  created() {
    // this.getFirm();
    console.log("本次路由跳转信息：", this.$route.params);
    this.input = this.$route.params.name 
    this.input2 = this.$route.params.bankAccount 
    this.input3 = this.$route.params.bankLocation 
    this.input4= this.$route.params.bank 
    // console.log('input',this.input,this.input2,this.input3,this.input4);
  },
}
</script>

<style scoped>
#gun {
  color: #0082cc;
}
.content-name{
  display: inline-block;
  width: 20%;
}

.el-input{
  width: 20%;
  display: inline-block;
}

#sure{
  width: 10%;
  margin-top: 10px;
  margin-left: 240px;
}
/* .el-button{
  width: 10%;
  margin-left: 300px;
  margin-top: 30px;


} */
/* #content>p:nth-of-type(1)>span{
  display: inline-block;
  width: 20%;
}
#content>p:nth-of-type(2)>span{
  display: inline-block;
  width: 20%;
}
#content>p:nth-of-type(3)>span{
  width: 20%;
  display: inline-block;
}
#content>p:nth-of-type(4)>span{
  width: 20%;
  display: inline-block;
} */
</style>